<style lang="less">
</style>
<template>
    <span>
        <Drawer title="场次安排" :closable="false" placement="right" v-model="examination" width="60%">
            <Row style="padding-top: 5px">
                <Table :loading="loading" border :columns="columns" :data="data" ref="userTable"></Table>
            </Row>
        </Drawer>
    </span>
</template>

<script>
    import {userExaTimeList} from "@/api/bus";
    export default {
        name: "exaTime-manage",
        components: {
        },
        data() {
            return {
                loading: false, // 表单加载状态
                examination: false,
                searchForm: {
                    examinationId: "",
                },
                selectDate: null, //选择日期绑定modal
                columns: [
                    {
                        type: "index",
                        width: 50,
                        align: "center"
                    },
                    {
                        title: "场次名称",
                        align: "center",
                        key: "childexamName"
                    },
                    {
                        title: "考试日期",
                        align: "center",
                        key: "examTime"
                    },
                    {
                        title: "开始时间",
                        align: "center",
                        key: "examStartTime"
                    },
                    {
                        title: "结束时间",
                        align: "center",
                        key: "examendTime"
                    }],
                data: [], // 表单数据
                total: 0 // 表单数据总数
            }
        },
        methods: {
            showDrawer(params){
                this.examination = true;
                if (params.exatimeId) {
                    this.searchForm.exatimeId = params.exatimeId;
                    this.getDataList();
                }else{
                    this.data = []
                }
            },
            getDataList() {
                this.loading = true;
                userExaTimeList(this.searchForm.exatimeId).then(res => {
                    this.loading = false;
                    if (res.status === true) {
                        this.data = res.data;
                    }
                });
            },
        },
        mounted() {
        }
    }
</script>
